<div class="form">

	<?php
	$properties = array(
		'id'=>'user-form',
		'enableAjaxValidation'=>false,
	);
	$form = $this->beginWidget('CActiveForm', $properties);
	$htmlOptions = array('size'=>60, 'maxlength'=>255, 'class'=>'fill');
	?>

	<p class="note">
		Fields with <span class="required">*</span> are required.
	</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php
		echo $form->labelEx($model, 'username');
		echo $form->textField($model, 'username', $htmlOptions);
		echo $form->error($model, 'username');
		?>
	</div>

	<?php if ($model->isNewRecord): ?>
		<div class="row">
			<?php
			echo $form->labelEx($model, 'password');
			echo $form->passwordField($model, 'password', $htmlOptions);
			echo $form->error($model, 'password');
			?>
		</div>

		<div class="row">
			<?php
			echo $form->labelEx($model, 'confirmPassword');
			echo $form->passwordField($model, 'confirmPassword', $htmlOptions);
			echo $form->error($model, 'confirmPassword');
			?>
		</div>
	<?php endif; ?>
	
	<div class="row">
		<?php
		echo $form->labelEx($model, 'email');
		echo $form->textField($model, 'email', $htmlOptions);
		echo $form->error($model, 'email');
		?>
	</div>

	<div class="row">
		<?php
		echo $form->labelEx($model, 'firstname');
		echo $form->textField($model, 'firstname', $htmlOptions);
		echo $form->error($model, 'firstname');
		?>
	</div>

	<div class="row">
		<?php
		echo $form->labelEx($model, 'lastname');
		echo $form->textField($model, 'lastname', $htmlOptions);
		echo $form->error($model, 'lastname');
		?>
	</div>

	<div class="row">
		<?php
		echo $form->labelEx($model, 'nickname');
		echo $form->textField($model, 'nickname', $htmlOptions);
		echo $form->error($model, 'nickname');
		?>
	</div>

	<div class="row buttons">
		<?php
		$label = $model->isNewRecord ? 'Create' : 'Save';
		echo CHtml::submitButton($label);
		?>
	</div>

	<?php $this->endWidget(); ?>

</div><!-- form -->